<?php
/* 
 * @author Jens Beyer
 * @date 04-09-2012
 */
class Ajax_Manager
{
    /**
     *
     * @var Ajax_Manager
     */
    static $_ajaxManager;

    /**
     *
     * @return Ajax_Manager
     */
    static function getInstance()
    {
        if (!self::$_ajaxManager) {
            self::$_ajaxManager = new Ajax_Manager();
        }
        return self::$_ajaxManager;
    }

    /**
     *
     * @param string $class_name
     * @return Ajax_Model
     */
    public function delegate($class_name)
    {
        $ajaxClassName = 'Ajax_Model_' . $class_name;
        $ajaxModel = new $ajaxClassName();
        return $ajaxModel;
    }
}
